﻿using MudBlazor.Utilities;

namespace MXERP.Blazor.Components
{
    public partial class HeaderCell<T> : MudComponentBase
    {
        private readonly Guid _id = Guid.NewGuid();

        [CascadingParameter]
        public Table<T> Table { get; set; } = default!;

        [Parameter]
        public Column<T> Column { get; set; } = default!;

        [Parameter]
        public RenderFragment? ChildContent { get; set; }

        private string _classname =>
            new CssBuilder(Column?.HeaderClassname)
                .AddClass(Class)
                .AddClass(Column?.CalcFixedClass())
            .Build();

        //private string _style =>
        //    new StyleBuilder()
        //        .AddStyle(Column?.HeaderStyleFunc?.Invoke(DataGrid?.CurrentPageItems ?? Enumerable.Empty<T>()))
        //        .AddStyle(Column?.HeaderStyle)
        //        .AddStyle("width", Width?.ToPx(), when: Width.HasValue)
        //        .AddStyle(Style)
        //    .Build();
    }
}
